<template>
	<view>
		<button @click="upload">上传</button>
		
		<image src="https://mp-bb37243e-7b26-41a3-9371-0d2bbb027341.cdn.bspapp.com/cloudstorage/055842aa-4557-42c1-9877-41c2f95e1edd.jpg" mode=""></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
		methods: {
			upload() {
				uni.chooseMedia({
					count: 1,
					success: resp => {
						const { tempFilePath } = resp.tempFiles[0]
						
						uniCloud.uploadFile({
							cloudPath: 'images/' + tempFilePath.split('/').pop(),
							filePath: tempFilePath,
							success: resp => {
								console.log(resp)
							}
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
